| Total Complexity | 3 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import React, { Component } from 'react' |
||
| 4 | |||
| 5 | |||
| 6 | export default class Variant extends Component { |
||
| 7 | static propTypes = { |
||
| 8 | name: PropTypes.string.isRequired, |
||
| 9 | weight: PropTypes.oneOfType([ |
||
| 10 | PropTypes.string, |
||
| 11 | PropTypes.number, |
||
| 12 | ]), |
||
| 13 | } |
||
| 14 | |||
| 15 | static isVariant = true |
||
| 16 | |||
| 17 | getName() { |
||
| 18 | return this.props.name |
||
| 19 | } |
||
| 20 | |||
| 21 | getWeight() { |
||
| 22 | return getWeight(this.props.weight) |
||
| 23 | } |
||
| 24 | |||
| 25 | render() { |
||
| 26 | return this.props.children |
||
| 27 | } |
||
| 29 |